package com.yanxibao.mapper;

import com.yanxibao.bean.Userinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
* @author kongke
* @description 针对表【yxb_userinfo】的数据库操作Mapper
* @createDate 2023-11-19 17:49:50
* @Entity com.yanxibao.bean.Userinfo
*/
@Mapper
public interface UserinfoMapper extends BaseMapper<Userinfo> {

    /**
     * 更新收藏数
     */
    @Update("update yxb_userinfo set collection = collection + 1 where user_id = #{uId}")
    Integer addCol(@Param("uId") String uId);

    /**
     * 更新历史数
     */
    @Update("update yxb_userinfo set historys = historys + 1 where user_id = #{uId}")
    Integer addHis(@Param("uId") String uId);

}




